{{- if not .Values.secret.external -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ .Values.secret.name }}
  labels:
    application: spilo
    spilo-cluster: {{ include "postgres-cluster.fullname" . }}
type: Opaque
data:
  postgresPassword: {{ .Values.secret.defaultPassword.postgresPassword | b64enc | quote }}
  replicationPassword: {{ .Values.secret.defaultPassword.replicationPassword | b64enc | quote }}
  adminPassword: {{ .Values.secret.defaultPassword.adminPassword | b64enc | quote }}
{{- end -}}